fix: oversampled fine state when the blurring mask is padded#358
Merged
Conversation
…llow-up) Discovered by the phase-3 workspace tests (autolens_workspace#232): when the mask sits close enough to the image edge that blurring_from(allow_padding=True) pads its output to a larger frame, the fine-state geometry built the image and blurring masks on different frames and raised a broadcast error (or would have mis-scattered). The image mask is now embedded into the padded frame with the same symmetric parity-preserving padding arithmetic; symmetric padding keeps the row-major slim ordering, so the permutations and the original image mask (used to wrap outputs) stay valid. Adds a padded-scene delta-kernel identity unit test. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up fix to #355 (oversampled PSF convolution core), found by the phase-3 workspace tests (PyAutoLabs/autolens_workspace#232): when the mask sits close enough to the image edge that
blurring_from(allow_padding=True)pads its output to a larger frame,_fine_state_frombuilt the image and blurring masks on different frames and raised a broadcast error inConvolverState.The image mask is now embedded into the padded frame using the same symmetric, parity-preserving padding arithmetic as
blurring_mask_2d_from. Symmetric padding preserves the row-major slim ordering of unmasked pixels, so the cached permutations and the original image mask (used to wrap outputs) remain valid.API Changes
None — bug fix only, +62/−3 in
convolver.py+ tests.Test Plan
convolution_over_sampled.pyfour-surface FitImaging coverage + s=2 FFT/real-space parity (ships in the companion autolens_workspace_test PR behind this merge).Validation checklist (--auto run)
🤖 Generated with Claude Code